<?php


namespace app\admin\controller;


use app\BaseController;
use app\service\Y;

class Util extends BaseController
{

    /**
     * 上传图片，调用存储插件，本地图片放入零时文件夹，业务保存时转入正式目录，支持云存储
     * @return \think\response\Json
     */
    public function image_upload(): \think\response\Json
    {
        $file_path = event('image_upload', '', true);
        $image = request()->domain() . $file_path;
        return Y::success(['path' => $file_path, 'image' => $image, 'src' => $image], '上传成功');
    }
}